<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户数据</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all">
</head>
<body>
<a th:href="@{'/user/add'}" class="layui-btn layui-btn-normal">增加</a>
    <table th:border="1" class="layui-table">
        <thead>
        <th>id</th>
        <th>name</th>
        <th>age</th>
        <th>操作</th>
        </thead>
        <tbody>
            <tr th:each="user:${userList}">
                <td>[[${user.id}]]</td>
                <td th:text="${user.name}"></td>
                <td th:text="${user.age}"></td>
                <td>
                    <a class="layui-btn layui-btn-normal">修改</a>
                    <a th:href="@{'/user/delete/'+${user.id}}" class="layui-btn layui-btn-danger">删除</a>
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>